Skip to main content

CanvasOperationSaveState

Type

statement

Summary

Save the current state of a canvas.

Syntax

save state of <mCanvas>

Description

Saves the current properties of mCanvas to the top of a stack so that they can be restored later.

Parameters

NameTypeDescription

mCanvas

An expression which evaluates to a canvas.

Examples

// Save the current canvas properties
save state of this canvas

// Change various properties of the canvas
set the paint of this canvas to solid paint with color [1,1,0,0.5]
set the blend mode of this canvas to "color dodge"
rotate this canvas by 30
set the font of this canvas to font "Helvetica" with size 15

// Restore the previous canvas properties
restore state of this canvas
Thank you for your feedback!

Was this page helpful?